/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import DAO.*;
import TO.*;
import Controller.*;
import java.util.Observer;
import java.util.Observable;
import java.util.Scanner;
import java.util.regex.*;

/**
 *
 * @author admin-pc
 */
public class BookView extends View implements Observer {

    Observable observable;
    private BookTO model;
    private BookController controller;
    private int id;
    private String tittle;
    private String status;

    public BookView(Observable observable, BookTO model, BookController controller) {
        this.observable = observable;
        this.model = model;
        this.controller = controller;
        observable.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {
        if (o instanceof BookTO) {
            BookTO bookTO = (BookTO) o;
            this.id = bookTO.getBookId();
            this.tittle = bookTO.getBookTitle();
            this.status = bookTO.getBookStatus();
        }
    }

}
